Skip to content

[JENKINS-71148] avoid empty tooltips#8975

Merged
NotMyFault merged 2 commits intojenkinsci:masterfrom
mawinter69:JENKINS-71148
Feb 24, 2024
Merged

[JENKINS-71148] avoid empty tooltips#8975
NotMyFault merged 2 commits intojenkinsci:masterfrom
mawinter69:JENKINS-71148

Conversation

@mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Feb 20, 2024

when the tooltip or html tooltip attribute is empty or whitespace only it is avoided that tippy is invoked at all which would otherwise just display a small but empty element.

Before:
image

After:
image

See JENKINS-71148.
Solves also JENKINS-72743 but in a generic way that also avoids empty tooltips in other places.
see also #8972

Testing done

Proposed changelog entries

Proposed upgrade guidelines

N/A

### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [ ] There is automated testing or an explanation as to why this change has no tests.
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

### Maintainer checklist
- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).

when the tooltip or html tooltip is empty or whitespace only it is
avoided that the tippy is invoked at all which would otherwise just
display a small but empty element.
Comment on lines 25 to 27
tooltip != null &&
tooltip.length > 0 &&
(htmlTooltip == null || htmlTooltip.length == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you doing null checks deliberately not with === etc? (Curiosity more than request for change)

Copy link
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work well, thanks 👍

Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 21, 2024
@NotMyFault NotMyFault added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Feb 21, 2024
@daniel-beck
Copy link
Member

daniel-beck commented Feb 22, 2024

NotMyFault added the regression-fix label

IMO not a regression. The tooltip that #8972 addresses has been empty since it was added in 2.220, with the problem existing probably far longer.

If you disagree, what release introduced the regression?

@mawinter69
Copy link
Contributor Author

I think it is a regression introduced with #6408 when YUI tooltips were replaced by tippy

@daniel-beck
Copy link
Member

daniel-beck commented Feb 22, 2024

That was merged in 2.380. Note the screenshot in my issue that I took in 2.220 (and that's just when that tooltip was added). So at least that specific instance is far older.

@NotMyFault NotMyFault added bug For changelog: Minor bug. Will be listed after features and removed regression-fix Pull request that fixes a regression in one of the previous Jenkins releases labels Feb 24, 2024
@NotMyFault NotMyFault merged commit 0675943 into jenkinsci:master Feb 24, 2024
krisstern pushed a commit to krisstern/jenkins that referenced this pull request Mar 5, 2024
* [JENKINS71148] avoid empty tooltips

when the tooltip or html tooltip is empty or whitespace only it is
avoided that the tippy is invoked at all which would otherwise just
display a small but empty element.

* better null checks

(cherry picked from commit 0675943)
@mawinter69 mawinter69 deleted the JENKINS-71148 branch January 31, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants